<div class="g12 nodrop" style="margin-bottom: 43px;">

    <div style="width: 100%;">

        <h3>Pregled direktorijuma</h3>

        <div class="ex_highlight_row grid">

            <table class="datatable border" cellpadding="0" cellspacing="0" id="example">

                <thead>                      
                    <tr style="background-image: url(<?=$url?>assets/img/sort_row_bg.gif); background-repeat: repeat-x; background-position: 0 0 ; border: 1px solid #ccc;">
                        <th class="tbleft">Naziv</th><th>Opis</th><th>Pripada</th><th>Akcija</th>
                    </tr>
                </thead>

                <tbody>

                    <?
                        foreach($directoryMedia as $row){?>

                        <tr style="border: 1px solid #ccc;">
                            <td class="tbleft tbbottom" style="text-align: left; vertical-align: middle; "><?=$row['name']?></td>
                            <td class="tbbottom" style="text-align: left; vertical-align: middle;"><?=$row['description']?></td>
                            <td class="tbbottom" style="text-align: left; vertical-align: middle;">
                                <? 
                                    if($row['parent']==1){
                                        echo '../';
                                    }else{
                                        foreach($directoryMedia as $row2){
                                            if($row['parent']==$row2['id'])echo $row2['name'];
                                        } 
                                    }

                            ?></td>

                            <td class="tbbottom" style="vertical-align: middle;">
                                <!--<a href="<?=$url?>directoryMedia/directorypreview?id=<?=$row['id']?>" class="small" id="<?=$row['id']?>">Pogledaj sadrÅ¾aj</a> |-->
                                <?if($row['parent']!=1){?>
                                <a href="<?=$url?>directoryMedia/editform?id=<?=$row['id']?>" class="small" id="<?=$row['id']?>">Uredi</a> |
                                <a href="javascript:" class="deletedirectory small" id="<?=$row['id']?>">Obriši</a>
                                <?}?>                                                           
                            </td> 
                        </tr>    

                        <?}

                    ?>

                </tbody>

            </table>

        </div>

    </div>

</div>
